<?php

namespace Agp\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Agp\CoreBundle\Validator\Constraints as CoreAssert;

/**
 * Agp\CoreBundle\Entity\Configuracao
 *
 * @ORM\Table(name="configuracao")
 * @ORM\Entity(repositoryClass="Agp\CoreBundle\Repository\ConfiguracaoRepository")
 * 
 */
class Configuracao
{
    /**
     * @var integer $codConfiguracao
     *
     * @ORM\Column(name="cod_configuracao", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * 
     */
    protected $codConfiguracao;
    
    const TM_VERDE = 'verde';
    const TM_AZUL = 'azul';
    const TM_VERMELHO = 'vermelho';
    
    /**
     * @var string $tema
     *
     * @ORM\Column(name="tema", type="string", length=42)
     * 
     * @Assert\NotBlank()
     */
    protected $tema;
    
    /**
     * @ORM\OneToOne(targetEntity="Agp\CoreBundle\Entity\Imagem", cascade={"all"})
     * @ORM\JoinColumn(name="cod_logo", referencedColumnName="cod_imagem", onDelete="set null")
     * @var object
     */
    protected $logo;
    
    /**
     * @var object $empresa
     *
     * @ORM\ManyToOne(targetEntity="Empresa", fetch="LAZY")
     * @ORM\JoinColumn(name="cod_empresa", referencedColumnName="cod_empresa")
     * 
     */
    protected $empresa;
    
    public function getCodConfiguracao() {
        return $this->codConfiguracao;
    }

    public function getTema() {
        return $this->tema;
    }

    public function getLogo() {
        return $this->logo;
    }

    public function setCodConfiguracao($codConfiguracao) {
        $this->codConfiguracao = $codConfiguracao;
        return $this;
    }

    public function setTema($tema) {
        $this->tema = $tema;
        return $this;
    }

    public function setLogo($logo) {
        $this->logo = $logo;
        return $this;
    }
    
    public static function getTermaList(){
        return array(self::TM_VERDE => ucfirst(self::TM_VERDE),
                     self::TM_AZUL => ucfirst(self::TM_AZUL),
                     self::TM_VERMELHO => ucfirst(self::TM_VERMELHO));
    }
    
    public function getEmpresa() {
        return $this->empresa;
    }

    public function setEmpresa($empresa) {
        $this->empresa = $empresa;
        return $this;
    }

}
